第15步:现在我们可以使用随机变量为流星设定一个新的速度。

由于 dino 被分配在这个碰撞事件的处理器中, dino 被称为 sprite,所有其他精灵在事件内部被称为 hit_sprite

  • 在事件内部,使用 Set x Speed hit_sprite 的x速度更改为 new_x_speed
  • 在事件内部,使用 Set y Speed hit_sprite 的y速度更改为 new_y_speed


To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)